<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>习惯详情 - 习惯掌控</title>
    <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
        }

        body {
            background-color: #f6f8fa;
            color: #333;
        }

        .container {
            max-width: 414px;
            margin: 0 auto;
            background-color: white;
            min-height: 100vh;
            position: relative;
            box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
        }

        .header {
            padding: 50px 20px 100px;
            background-color: #4CAF50;
            color: white;
        }

        .header-top {
            display: flex;
            align-items: center;
            margin-bottom: 20px;
        }

        .back-button {
            margin-right: 15px;
            font-size: 20px;
        }

        .title {
            font-size: 20px;
            font-weight: bold;
            flex: 1;
        }

        .more-button {
            font-size: 20px;
        }

        .habit-icon {
            width: 60px;
            height: 60px;
            background-color: white;
            color: #4CAF50;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 24px;
            margin: 0 auto 15px;
        }

        .habit-title {
            font-size: 24px;
            font-weight: bold;
            text-align: center;
            margin-bottom: 5px;
        }

        .habit-schedule {
            text-align: center;
            opacity: 0.9;
            font-size: 14px;
        }

        .habit-detail {
            margin-top: -60px;
            padding: 20px;
        }

        .stats-card {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
            margin-bottom: 20px;
        }

        .stats-row {
            display: flex;
            justify-content: space-around;
            text-align: center;
        }

        .stats-item {
            flex: 1;
            padding: 10px;
        }

        .stats-value {
            font-size: 28px;
            font-weight: bold;
            color: #4CAF50;
            margin-bottom: 5px;
        }

        .stats-label {
            font-size: 13px;
            color: #666;
        }

        .detail-section {
            background-color: white;
            border-radius: 10px;
            padding: 20px;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
            margin-bottom: 20px;
        }

        .section-title {
            font-size: 16px;
            font-weight: bold;
            margin-bottom: 15px;
            display: flex;
            justify-content: space-between;
            align-items: center;
        }

        .section-action {
            color: #4CAF50;
            font-size: 14px;
            font-weight: normal;
        }

        .calendar {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            gap: 8px;
        }

        .calendar-header {
            display: grid;
            grid-template-columns: repeat(7, 1fr);
            margin-bottom: 10px;
        }

        .calendar-day {
            text-align: center;
            font-size: 12px;
            color: #999;
        }

        .calendar-cell {
            aspect-ratio: 1;
            border-radius: 4px;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 12px;
            border: 1px solid #eee;
        }

        .calendar-cell.completed {
            background-color: #4CAF50;
            color: white;
            border-color: #4CAF50;
        }

        .calendar-cell.today {
            border-color: #4CAF50;
            border-width: 2px;
        }

        .month-selector {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 15px;
        }

        .month-nav {
            width: 30px;
            height: 30px;
            display: flex;
            align-items: center;
            justify-content: center;
            background-color: #f2f2f2;
            border-radius: 50%;
            color: #666;
        }

        .month-title {
            font-weight: bold;
        }

        .notes-list {
            max-height: 300px;
            overflow-y: auto;
        }

        .note-item {
            padding: 15px;
            border-bottom: 1px solid #eee;
        }

        .note-date {
            font-size: 12px;
            color: #666;
            margin-bottom: 5px;
        }

        .note-text {
            font-size: 14px;
            line-height: 1.4;
        }

        .note-image {
            width: 100%;
            border-radius: 8px;
            margin-top: 10px;
            max-height: 150px;
            object-fit: cover;
        }

        .note-input {
            display: flex;
            align-items: center;
            margin-top: 15px;
            padding: 10px;
            background-color: #f5f5f5;
            border-radius: 20px;
        }

        .note-input input {
            flex: 1;
            border: none;
            outline: none;
            background: transparent;
            padding: 5px;
            font-size: 14px;
        }

        .note-input-icon {
            width: 30px;
            height: 30px;
            border-radius: 50%;
            background-color: #4CAF50;
            color: white;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-left: 10px;
        }

        .chart-container {
            height: 150px;
            display: flex;
            align-items: flex-end;
            margin-top: 20px;
            padding-bottom: 15px;
        }

        .bar {
            flex: 1;
            margin: 0 5px;
            min-width: 20px;
        }

        .bar-fill {
            background-color: #4CAF50;
            border-radius: 3px 3px 0 0;
        }

        .bar-label {
            text-align: center;
            font-size: 11px;
            color: #666;
            margin-top: 5px;
        }

        .habit-actions {
            position: fixed;
            bottom: 0;
            width: 100%;
            max-width: 414px;
            display: flex;
            padding: 15px;
            background-color: white;
            box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        }

        .habit-action {
            flex: 1;
            padding: 12px;
            border-radius: 8px;
            text-align: center;
            font-weight: bold;
            font-size: 15px;
        }

        .edit-button {
            background-color: #f2f2f2;
            color: #666;
            margin-right: 10px;
        }

        .checkin-button {
            background-color: #4CAF50;
            color: white;
        }

        .theory-section {
            background-color: #f8f9fa;
            border-radius: 10px;
            padding: 15px;
            margin-top: 10px;
        }

        .theory-title {
            font-weight: bold;
            color: #4CAF50;
            margin-bottom: 10px;
            display: flex;
            align-items: center;
        }

        .theory-title i {
            margin-right: 8px;
        }

        .theory-text {
            font-size: 14px;
            line-height: 1.4;
            color: #666;
        }

        .empty-space {
            height: 80px;
        }
    </style>
</head>

<body>
    <div class="container">
        <div class="header">
            <div class="header-top">
                <div class="back-button">
                    <i class="fas fa-arrow-left"></i>
                </div>
                <div class="title">习惯详情</div>
                <div class="more-button">
                    <i class="fas fa-ellipsis-vertical"></i>
                </div>
            </div>

            <div class="habit-icon">
                <i class="fas fa-running"></i>
            </div>
            <div class="habit-title">晨跑5公里</div>
            <div class="habit-schedule">每天 6:00</div>
        </div>

        <div class="habit-detail">
            <div class="stats-card">
                <div class="stats-row">
                    <div class="stats-item">
                        <div class="stats-value">31</div>
                        <div class="stats-label">连续天数</div>
                    </div>
                    <div class="stats-item">
                        <div class="stats-value">95%</div>
                        <div class="stats-label">完成率</div>
                    </div>
                    <div class="stats-item">
                        <div class="stats-value">102</div>
                        <div class="stats-label">总完成次数</div>
                    </div>
                </div>
            </div>

            <div class="detail-section">
                <div class="section-title">
                    月度概览
                </div>
                <div class="month-selector">
                    <div class="month-nav">
                        <i class="fas fa-chevron-left"></i>
                    </div>
                    <div class="month-title">2023年10月</div>
                    <div class="month-nav">
                        <i class="fas fa-chevron-right"></i>
                    </div>
                </div>
                <div class="calendar-header">
                    <div class="calendar-day">一</div>
                    <div class="calendar-day">二</div>
                    <div class="calendar-day">三</div>
                    <div class="calendar-day">四</div>
                    <div class="calendar-day">五</div>
                    <div class="calendar-day">六</div>
                    <div class="calendar-day">日</div>
                </div>
                <div class="calendar">
                    <div class="calendar-cell"></div>
                    <div class="calendar-cell"></div>
                    <div class="calendar-cell"></div>
                    <div class="calendar-cell completed">1</div>
                    <div class="calendar-cell completed">2</div>
                    <div class="calendar-cell completed">3</div>
                    <div class="calendar-cell completed">4</div>
                    <div class="calendar-cell completed">5</div>
                    <div class="calendar-cell completed">6</div>
                    <div class="calendar-cell completed">7</div>
                    <div class="calendar-cell completed">8</div>
                    <div class="calendar-cell completed">9</div>
                    <div class="calendar-cell completed">10</div>
                    <div class="calendar-cell completed">11</div>
                    <div class="calendar-cell completed">12</div>
                    <div class="calendar-cell completed">13</div>
                    <div class="calendar-cell completed">14</div>
                    <div class="calendar-cell today completed">15</div>
                    <div class="calendar-cell">16</div>
                    <div class="calendar-cell">17</div>
                    <div class="calendar-cell">18</div>
                    <div class="calendar-cell">19</div>
                    <div class="calendar-cell">20</div>
                    <div class="calendar-cell">21</div>
                    <div class="calendar-cell">22</div>
                    <div class="calendar-cell">23</div>
                    <div class="calendar-cell">24</div>
                    <div class="calendar-cell">25</div>
                    <div class="calendar-cell">26</div>
                    <div class="calendar-cell">27</div>
                    <div class="calendar-cell">28</div>
                    <div class="calendar-cell">29</div>
                    <div class="calendar-cell">30</div>
                    <div class="calendar-cell">31</div>
                </div>
            </div>

            <div class="detail-section">
                <div class="section-title">
                    每周统计
                </div>
                <div class="chart-container">
                    <div class="bar">
                        <div class="bar-fill" style="height: 80%"></div>
                        <div class="bar-label">周一</div>
                    </div>
                    <div class="bar">
                        <div class="bar-fill" style="height: 100%"></div>
                        <div class="bar-label">周二</div>
                    </div>
                    <div class="bar">
                        <div class="bar-fill" style="height: 90%"></div>
                        <div class="bar-label">周三</div>
                    </div>
                    <div class="bar">
                        <div class="bar-fill" style="height: 100%"></div>
                        <div class="bar-label">周四</div>
                    </div>
                    <div class="bar">
                        <div class="bar-fill" style="height: 95%"></div>
                        <div class="bar-label">周五</div>
                    </div>
                    <div class="bar">
                        <div class="bar-fill" style="height: 60%"></div>
                        <div class="bar-label">周六</div>
                    </div>
                    <div class="bar">
                        <div class="bar-fill" style="height: 50%"></div>
                        <div class="bar-label">周日</div>
                    </div>
                </div>
            </div>

            <div class="detail-section">
                <div class="section-title">
                    习惯笔记
                    <div class="section-action">查看全部</div>
                </div>
                <div class="notes-list">
                    <div class="note-item">
                        <div class="note-date">2023-10-15</div>
                        <div class="note-text">今天跑了5公里，感觉很棒！</div>
                        <div class="note-image">
                            <img src="https://images.unsplash.com/photo-1461896836934-ffe607ba8211?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80" alt="Note Image" width="80">
                        </div>
                    </div>
                    <div class="note-item">
                        <div class="note-date">2023-10-14</div>
                        <div class="note-text">昨天因为工作忙，没有跑。明天一定要补上！</div>
                        <div class="note-image">
                            <img src="https://images.unsplash.com/photo-1461896836934-ffe607ba8211?ixlib=rb-4.0.3&ixid=MnwxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8&auto=format&fit=crop&w=1170&q=80" alt="Note Image" width="80">
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="habit-actions">
            <div class="habit-action edit-button">编辑</div>
            <div class="habit-action checkin-button">打卡</div>
        </div>
    </div>
</body>

</html>